import 'package:flutter/material.dart';

class GenderSelectionPage extends StatelessWidget {
  final int currentGender;

  const GenderSelectionPage({super.key, required this.currentGender});

  @override
  Widget build(BuildContext context) {
    final List<Map<String, Object>> genders = [
      {'label': '男', 'value': 0},
      {'label': '女', 'value': 1},
    ];

    return Scaffold(
      appBar: AppBar(title: const Text('选择性别')),
      body: ListView(
        children: genders.map((gender) {
          final selected = gender['value'] == currentGender;
          return ListTile(
            title: Text(gender['label'] as String),
            trailing: selected
                ? const Icon(Icons.check, color: Colors.blue)
                : null,
            onTap: () {
              Navigator.pop(context, gender['value'] as int);
            },
          );
        }).toList(),
      ),
    );
  }
}
